/*input输入框*/
$(document).ready(function(){

	$('input[type=text]:first').focus();

});
/*验证*/
function msgtitle(obj){
	var data = $(obj).val();
	// console.log(data);
	if(data.match(/[a-zA-Z0-9\u4e00-\u9fa5]\S/)){
		le.innerHTML="";
		$('#le').addClass('myred');
    	$('#but_q').removeAttr("disabled");
	}else{
	
    	le.innerHTML="× 您输入的格式不正确！";
        $('#le').addClass('myred');
        $('#but_q').attr("disabled","disabled");
	}

}

function message(obj){
	var val = $(obj).val();
	
	if (val.match(/(http[s]?|ftp):\/\/[^\/\.]+?\..+\w$/i) == null) {
		mymessage.innerHTML="× 您输入的格式不正确！";
        $('#mymessage').addClass('myred');
        $('#but_q').attr("disabled","disabled");
    }else{
    	mymessage.innerHTML="";
    	$('#but_q').removeAttr("disabled");
    }
}


function change(obj){
	var src = $(obj).attr('src');
	$('.wid_c').toggle('100');
	$('#img_h').attr('src',src);

}


function change_d(obj){
	$(obj).toggle();
}




function k_name(obj){
	var val= $(obj).val();
	// console.log(val);
	if(val.match(/[a-zA-Z0-9\u4e00-\u9fa5]\S/)){
		kb_name.innerHTML= "";
		$('#btn-edit').removeAttr("disabled");

	}else{
		kb_name.innerHTML='× 你输入的格式有误!'
		$('#kb_name').addClass('myred');
		$('#btn-edit').attr('disabled','disabled');

	}
}

function k_lian(obj){
	var val = $(obj).val();
	// console.log(val);
	if(val.match(/(http[s]?|ftp):\/\/[^\/\.]+?\..+\w$/i)){
		kb_lian.innerHTML =''; 
		$('#btn-edit').removeAttr('disabled');

	}else{
		kb_lian.innerHTML = '× 你输入的格式有误!';
		$('#btn-edit').attr('disabled','disabled');
		$('#kb_lian').addClass('myred');
	}

}


function k_tit(obj){
	var val= $(obj).val();

	if(val.match(/[a-zA-Z0-9\u4e00-\u9fa5]\S/)){
		kb_title.innerHTML="";
		$('#in_but').removeAttr('disabled');
	}else{
		kb_title.innerHTML="你输入的标题格式有误！";
		$('#kb_title').addClass('myred');
		$('#in_but').attr('disabled','disabled');
	}
}


function k_tid(obj){
	var val = $(obj).val();
	// console.log(val);
	if(val.match(/^[0-9]*\S$/)){
		ksb_tid.innerHTML = "";
		$('#in_but').removeAttr('disabled');
	}else{
		ksb_tid.innerHTML ='你输入的排序格式有误！';
		$('#in_but').attr('disabled','disabled');
		$('#ksb_tid').addClass('myred'); 
	}
}


function k_textc(obj){
	var val = $(obj).val();
	console.log(val);

	if(val.match(/[a-zA-Z0-9\u4e00-\u9fa5]\S/)){
		kb_textc.innerHTML="";
		$('#in_but').removeAttr('disabled');
	}else{
		kb_textc.innerHTML = "你输入的文本格式有误!";
		$('#in_but').attr('disabled','disabled');
		$('#kb_textc').addClass('myred');
	}
}






















